package projet_v1.simulation.events;

import java.awt.Dimension;
import java.util.List;

import projet_v1.Character;
import projet_v1.simulation.Field;
import projet_v1.simulation.Location;
/**
 * This class manages the events like rescue or chimical attack
 * 
 * @author Romain Roufast
 *
 */
public abstract class Event {

	public static int IS_GOOD_FOR_HUMANITY = 0;
	public static int IS_BAD_FOR_HUMANITY = 1;
	public static int RANDOM_EVENT = 2;
	
	// area of the event effect
	protected Location startLocation;
	// the dimensions of the event (e.g. if dimension==2, the 24 cases around the start location will be added to a list)
	protected int dimension;
	// the duration of the event
	protected int duration;
	// the type of the event
	private int typeEvent;
	
	
	public Event(Location l, int d, int type) {
		startLocation = l;
		dimension = d;
		duration = 0;
		typeEvent = type;
	}
	
	// Accessors
	public int getTypeEvent() {
		return typeEvent;
	}
	
	public Location getStartLocation() {
		return startLocation;
	}
	
	
	public void changeStartLocation(Location l) {
		startLocation = l;
	}
	
	/**
	 * What happend when an event occur
	 * The behaviour of the event
	 * @param characters
	 * @param field
	 * @return true if the event still has effect
	 */
	public abstract boolean happend(List<Character> characters, Field field);
}
